import { useUserStoreWithout } from '../../store/modules/user';

const userStore = useUserStoreWithout();

export function isTenant(): boolean {
  const userInfo = userStore.getUserInfo;
  return userInfo.userType === 1 ? true : false;
}

export function getTenantCode(): string | undefined {
  return userStore.getUserInfo.tenantCode;
}

export function getUserId(): string | undefined {
  return userStore.getUserInfo.userId;
}

export function isBusinessUi(): boolean {
  return userStore.getUserInfo.tokenType === 'session' ? true : false;
}

export function getToken(): string {
  return userStore.getToken;
}
